//
//  FoodProjectDetailCell.m
//  B段项目
//
//  Created by dllo on 15/11/10.
//  Copyright © 2015年 徐茂怀. All rights reserved.
//

#import "FoodProjectDetailCell.h"
#import "FitHeader.h"
@implementation FoodProjectDetailCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createViews];
    }
    return self;
}

-(void)createViews
{
    _thumbImageView = [[UIImageView alloc]init];
    [self.contentView addSubview:_thumbImageView];
    
    _titleLabel = [[UILabel alloc]init];
    [self.contentView addSubview:_titleLabel];
    
    _categoryLabel = [[UILabel alloc]init];
    [self.contentView addSubview:_categoryLabel];
    
    _ageLabel = [[UILabel alloc]init];
    [self.contentView addSubview:_ageLabel];
    
    _effectLabel = [[UILabel alloc]init];
    [self.contentView addSubview:_effectLabel];
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    [_thumbImageView setFrame:CGRectMake(10 * FitWidth, 15 * FitHeight, 100 * FitWidth, 65 * FitHeight)];
    
    [_titleLabel setFrame:CGRectMake(_thumbImageView.frame.origin.x + _thumbImageView.frame.size.width + 10 * FitWidth, 10 * FitHeight, self.frame.size.width - _titleLabel.frame.origin.x, 20 * FitHeight)];
    _titleLabel.font = [UIFont systemFontOfSize:17 * FitWidth];
    
    [_categoryLabel setFrame:CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.origin.y + _titleLabel.frame.size.height + 5 * FitHeight, _titleLabel.frame.size.width, 15 * FitHeight)];
    _categoryLabel.font = [UIFont systemFontOfSize:14 * FitWidth];
    _categoryLabel.textColor = [UIColor grayColor];
    
    [_ageLabel setFrame:CGRectMake(_categoryLabel.frame.origin.x, _categoryLabel.frame.origin.y + _categoryLabel.frame.size.height + 5 * FitHeight, _categoryLabel.frame.size.width, _categoryLabel.frame.size.height)];
    _ageLabel.font = _categoryLabel.font;
    _ageLabel.textColor = _categoryLabel.textColor;
    
    [_effectLabel setFrame:CGRectMake(_ageLabel.frame.origin.x, _ageLabel.frame.origin.y + _ageLabel.frame.size.height + 5 * FitHeight, _ageLabel.frame.size.width, _ageLabel.frame.size.height)];
    _effectLabel.font = _ageLabel.font;
    _effectLabel.textColor = _ageLabel.textColor;
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
